home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc™ Source Code / Storage / Bento / MemHdr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-28  |  3.6 KB  |  126 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        MemHdr.h
  3.  
  4.     Contains:    ODMemContainer header
  5.  
  6.     Owned by:    Vincent Lo
  7.  
  8.     Copyright:    © 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <2>      5/1/96    JA        1314704: Added fHandleSize. Removed zone
  13.                                     stuff.
  14.          <2>     6/20/94    CC        ODMemoryHeap* changed to ODMemoryHeapID.
  15.          <1>     5/27/94    VL        first checked in
  16.     To Do:
  17.     
  18.     In Progress:
  19.         
  20. */
  21.  
  22. #ifndef _MEMHDR_
  23. #define _MEMHDR_
  24.  
  25. #ifndef _ODTYPES_
  26. #include "ODTypes.h"
  27. #endif
  28.  
  29. #ifndef _BENTOHDR_
  30. #include "BentoHdr.h"
  31. #endif
  32.  
  33. #ifndef __CM_API__
  34. #include "CMAPI.h"
  35. #endif
  36.  
  37. #ifndef __CM_API_TYPES__
  38. #include "CMAPITyp.h"
  39. #endif
  40.  
  41. #ifndef _ODMEMORY_
  42. #include "ODMemory.h"
  43. #endif
  44.  
  45. #ifndef _PLFMDEF_
  46. #include "PlfmDef.h"
  47. #endif
  48.  
  49. //==============================================================================
  50. // Theory of Operation
  51. //==============================================================================
  52.  
  53. //==============================================================================
  54. // Constants
  55. //==============================================================================
  56. extern const ODType kODBentoMemoryTypeName; // = "MemoryCtr";
  57.  
  58. //==============================================================================
  59. // Scalar Types
  60. //==============================================================================
  61.  
  62. //==============================================================================
  63. // Classes defined in this interface
  64. //==============================================================================
  65. class ODMemBentoHandlers;
  66.  
  67. //==============================================================================
  68. // Classes used by this interface
  69. //==============================================================================
  70.  
  71. //==============================================================================
  72. // ODMemBentoHandlers
  73. //==============================================================================
  74.  
  75. class ODMemBentoHandlers : public ODBentoHandlers
  76. {
  77. public:
  78.  
  79.     ODMemBentoHandlers(CMSession session, ODHandle data);
  80.     ODVMethod ~ODMemBentoHandlers();
  81.     
  82.     ODMethod void Initialize();
  83.     ODMethod CMSession GetCMSession();
  84.     
  85.     ODMethod CMRefCon OpenHandler(CMOpenMode mode);
  86.     ODMethod void CloseHandler();
  87.     ODMethod CMSize FlushHandler();
  88.     ODMethod CMSize SeekHandler(CM_LONG posOff, CMSeekMode mode);
  89.     ODMethod CMSize TellHandler();
  90.     ODMethod CMSize ReadHandler(CMPtr buffer, CMSize elementSize, CMCount theCount);
  91.     ODMethod CMSize WriteHandler(CMPtr buffer, CMSize elementSize, CMCount theCount);
  92.     ODMethod CMEofStatus EOFHandler();
  93.     ODMethod CMBoolean TruncHandler(CMSize containerSize);
  94.     ODMethod CMSize ContainerSizeHandler();
  95.     ODMethod void ReadLabelHandler(CMMagicBytes magicByteSequence,
  96.                         CMContainerFlags *flags, CM_USHORT *bufSize,
  97.                         CM_USHORT *majorVersion, CM_USHORT *minorVersion,
  98.                         CMSize *tocOffset, CMSize *tocSize);
  99.     ODMethod void WriteLabelHandler(CMMagicBytes magicByteSequence,
  100.                         CMContainerFlags flags, CM_USHORT bufSize,
  101.                         CM_USHORT majorVersion, CM_USHORT minorVersion,
  102.                         CMSize tocOffset, CMSize tocSize);
  103.     ODMethod CMValue ReturnParentValueHandler();
  104.     ODMethod CM_UCHAR* ReturnContainerNameHandler();
  105.     ODMethod CMType ReturnTargetTypeHandler(CMContainer container);
  106.     ODMethod void ExtractDataHandler(CMDataBuffer buffer,
  107.                             CMSize size, CMPrivateData data);
  108.     ODMethod void FormatDataHandler(CMDataBuffer buffer,
  109.                             CMSize size,
  110.                             CMPrivateData data);
  111.  
  112. private:
  113.  
  114.     CMSession    fSession;
  115.     ODHandle   fData;
  116.     ODBoolean  fAllocated;
  117.     CMSize      fSize;
  118.     CMSize        fHandleSize;
  119.     ODBoolean    fSeekValid;
  120.     ODULong    fSeekPos;
  121.     ODSLong    fLastSeekOffset;
  122.     ODSShort    fLastSeekMode;
  123.     ODBoolean  fEOFReached;
  124. };
  125.  
  126. #endif // _MEMHDR_